<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>{{message}}</h1>

        <ul class="info" v-if="Object.keys(info).length">
            <li>名字：{{info.name}}</li>
            <li>年龄：{{info.age}}</li>
        </ul>
        <!-- 不可见的包裹元素 不会被渲染出来 减少一点点开销 -->
        <templste v-else="object.key(info).length">
            <h2>为空啦</h2>
        </templste>
        
    </div>
    <script src="https://unpkg.com/vue@next"></script>
    <script>
        //用vue创建app
        const app = Vue.createApp({
            // template: `

            // `,
            data() {
                return {
                    message: "Hello world",
                    info: {name:"ran",age:19}
                }
            },
            methods: {

            }
        })
        //挂载app
        app.mount("#app")
    </script>

</body>

</html>